<!DOCTYPE HTML>
<html lang="en" >
    
    <head>
        
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=11; IE=10; IE=9; IE=8; IE=7; IE=EDGE" />
        <title>发布到Github Pages | Gitbook 入门教程</title>
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <meta name="description" content="">
        <meta name="generator" content="GitBook 2.0.1">
        
        
        <meta name="HandheldFriendly" content="true"/>
        <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
        <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">
        
    
    
    <link rel="next" href="../end/index.html" />
    
    
    <link rel="prev" href="../publish/github.html" />
    

        
    </head>
    <body>
        
        
    <link rel="stylesheet" href="../gitbook/style.css">
    
    

        
    <div class="book" data-level="4.3" data-basepath=".." data-revision="Mon Apr 13 2015 22:07:26 GMT+0800 (中国标准时间)">
    

<div class="book-summary">
    <div class="book-search">
        <input type="text" placeholder="Type to search" class="form-control" />
    </div>
    <ul class="summary">
        
        
        
        

        

        
    
        <li class="chapter " data-level="0" data-path="index.html">
            
                
                    <a href="../index.html">
                        <i class="fa fa-check"></i>
                        
                        Introduction
                    </a>
                
            
            
        </li>
    
        <li class="chapter " data-level="1" data-path="howtouse/index.html">
            
                
                    <a href="../howtouse/index.html">
                        <i class="fa fa-check"></i>
                        
                            <b>1.</b>
                        
                        基本安装
                    </a>
                
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1" data-path="howtouse/Nodejsinstall.html">
            
                
                    <a href="../howtouse/Nodejsinstall.html">
                        <i class="fa fa-check"></i>
                        
                            <b>1.1.</b>
                        
                        Node.js安装
                    </a>
                
            
            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="howtouse/gitbookinstall.html">
            
                
                    <a href="../howtouse/gitbookinstall.html">
                        <i class="fa fa-check"></i>
                        
                            <b>1.2.</b>
                        
                        Gitbook安装
                    </a>
                
            
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="howtouse/gitbookcli.html">
            
                
                    <a href="../howtouse/gitbookcli.html">
                        <i class="fa fa-check"></i>
                        
                            <b>1.3.</b>
                        
                        Gitbook命令行速览
                    </a>
                
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2" data-path="book/index.html">
            
                
                    <a href="../book/index.html">
                        <i class="fa fa-check"></i>
                        
                            <b>2.</b>
                        
                        图书编辑
                    </a>
                
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1" data-path="book/gitbook-cli.html">
            
                
                    <a href="../book/gitbook-cli.html">
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.</b>
                        
                        gitbook命令行&amp;markdown编辑
                    </a>
                
            
            
        </li>
    
        <li class="chapter " data-level="2.2" data-path="book/editor.html">
            
                
                    <a href="../book/editor.html">
                        <i class="fa fa-check"></i>
                        
                            <b>2.2.</b>
                        
                        gitbook editor编辑
                    </a>
                
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3" data-path="output/index.html">
            
                
                    <a href="../output/index.html">
                        <i class="fa fa-check"></i>
                        
                            <b>3.</b>
                        
                        图书输出
                    </a>
                
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.1" data-path="output/outfile.html">
            
                
                    <a href="../output/outfile.html">
                        <i class="fa fa-check"></i>
                        
                            <b>3.1.</b>
                        
                        输出为静态网站
                    </a>
                
            
            
        </li>
    
        <li class="chapter " data-level="3.2" data-path="output/pdfandebook.html">
            
                
                    <a href="../output/pdfandebook.html">
                        <i class="fa fa-check"></i>
                        
                            <b>3.2.</b>
                        
                        输出PDF
                    </a>
                
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="4" data-path="publish/index.html">
            
                
                    <a href="../publish/index.html">
                        <i class="fa fa-check"></i>
                        
                            <b>4.</b>
                        
                        发布
                    </a>
                
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.1" data-path="publish/gitbook.html">
            
                
                    <a href="../publish/gitbook.html">
                        <i class="fa fa-check"></i>
                        
                            <b>4.1.</b>
                        
                        发布到gitbook.com
                    </a>
                
            
            
        </li>
    
        <li class="chapter " data-level="4.2" data-path="publish/github.html">
            
                
                    <a href="../publish/github.html">
                        <i class="fa fa-check"></i>
                        
                            <b>4.2.</b>
                        
                        发布到github仓库
                    </a>
                
            
            
        </li>
    
        <li class="chapter active" data-level="4.3" data-path="publish/gitpages.html">
            
                
                    <a href="../publish/gitpages.html">
                        <i class="fa fa-check"></i>
                        
                            <b>4.3.</b>
                        
                        发布到Github Pages
                    </a>
                
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="5" data-path="end/index.html">
            
                
                    <a href="../end/index.html">
                        <i class="fa fa-check"></i>
                        
                            <b>5.</b>
                        
                        结束
                    </a>
                
            
            
        </li>
    


        
        <li class="divider"></li>
        <li>
            <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
                Published with GitBook
            </a>
        </li>
        
    </ul>
</div>

    <div class="book-body">
        <div class="body-inner">
            <div class="book-header">
    <!-- Actions Left -->
    <a href="#" class="btn pull-left toggle-summary" aria-label="Table of Contents"><i class="fa fa-align-justify"></i></a>
    <a href="#" class="btn pull-left toggle-search" aria-label="Search"><i class="fa fa-search"></i></a>
    
    <div id="font-settings-wrapper" class="dropdown pull-left">
        <a href="#" class="btn toggle-dropdown" aria-label="Font Settings"><i class="fa fa-font"></i>
        </a>
        <div class="dropdown-menu font-settings">
    <div class="dropdown-caret">
        <span class="caret-outer"></span>
        <span class="caret-inner"></span>
    </div>

    <div class="buttons">
        <button type="button" id="reduce-font-size" class="button size-2">A</button>
        <button type="button" id="enlarge-font-size" class="button size-2">A</button>
    </div>

    <div class="buttons font-family-list">
        <button type="button" data-font="0" class="button">Serif</button>
        <button type="button" data-font="1" class="button">Sans</button>
    </div>

    <div class="buttons color-theme-list">
        <button type="button" id="color-theme-preview-0" class="button size-3" data-theme="0">White</button>
        <button type="button" id="color-theme-preview-1" class="button size-3" data-theme="1">Sepia</button>
        <button type="button" id="color-theme-preview-2" class="button size-3" data-theme="2">Night</button>
    </div>
</div>

    </div>

    <!-- Actions Right -->
    
    <div class="dropdown pull-right">
        <a href="#" class="btn toggle-dropdown" aria-label="Share"><i class="fa fa-share-alt"></i>
        </a>
        <div class="dropdown-menu font-settings dropdown-left">
            <div class="dropdown-caret">
                <span class="caret-outer"></span>
                <span class="caret-inner"></span>
            </div>
            <div class="buttons">
                <button type="button" data-sharing="twitter" class="button">
                    Share on Twitter
                </button>
                <button type="button" data-sharing="google-plus" class="button">
                    Share on Google
                </button>
                <button type="button" data-sharing="facebook" class="button">
                    Share on Facebook
                </button>
                <button type="button" data-sharing="weibo" class="button">
                    Share on Weibo
                </button>
                <button type="button" data-sharing="instapaper" class="button">
                    Share on Instapaper
                </button>
            </div>
        </div>
    </div>
    

    
    <a href="#" target="_blank" class="btn pull-right google-plus-sharing-link sharing-link" data-sharing="google-plus" aria-label="Google"><i class="fa fa-google-plus"></i></a>
    
    
    <a href="#" target="_blank" class="btn pull-right facebook-sharing-link sharing-link" data-sharing="facebook" aria-label="Facebook"><i class="fa fa-facebook"></i></a>
    
    
    <a href="#" target="_blank" class="btn pull-right twitter-sharing-link sharing-link" data-sharing="twitter" aria-label="Twitter"><i class="fa fa-twitter"></i></a>
    
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../" >Gitbook 入门教程</a>
    </h1>
</div>

            <div class="page-wrapper" tabindex="-1">
                <div class="page-inner">
                
                
                    <section class="normal" id="section-">
                    
                        <h1 id="%E5%8F%91%E5%B8%83%E5%88%B0github-pages">&#x53D1;&#x5E03;&#x5230;github pages</h1>
<p>&#x5C06;&#x751F;&#x7F16;&#x5199;&#x597D;&#x7684;&#x683C;&#x5F0F;&#x4E3A;.md&#x7684;&#x6587;&#x4EF6;&#x901A;&#x8FC7;Gitbook&#x5904;&#x7406;&#xFF0C;&#x7136;&#x540E;&#x518D;&#x53D1;&#x5E03;&#x5230;Github Gages&#x4E0A;&#x53BB;&#x3002;&#x6211;&#x4E2A;&#x4EBA;&#x6BD4;&#x8F83;&#x559C;&#x6B22;&#x5C06;&#x6E90;&#x7801;&#xFF0C;&#x5373;<code>.md</code>&#x6587;&#x4EF6;&#x4E0E;Github Pages&#x9759;&#x6001;&#x6587;&#x4EF6;&#x5B58;&#x653E;&#x5728;&#x4E00;&#x4E2A;&#x4ED3;&#x5E93;&#x4E2D;&#x3002;<code>.md</code>&#x6587;&#x4EF6;&#x4E3A;<code>master</code>&#x5206;&#x652F;&#xFF0C;&#x800C;hmtl&#x6587;&#x4EF6;&#x4E3A;<code>gh-pages</code>&#x5206;&#x652F;&#x3002;&#x5177;&#x4F53;&#x6D41;&#x7A0B;&#x662F;&#x8FD9;&#x6837;&#x7684;&#xFF1A;</p>
<h2 id="%E5%88%9B%E5%BB%BA%E4%BB%93%E5%BA%93%E4%B8%8E%E5%88%86%E6%94%AF">&#x521B;&#x5EFA;&#x4ED3;&#x5E93;&#x4E0E;&#x5206;&#x652F;</h2>
<ul>
<li>&#x767B;&#x5F55;&#x5230;Github&#xFF0C;&#x521B;&#x5EFA;&#x4E00;&#x4E2A;&#x65B0;&#x7684;&#x4ED3;&#x5E93;&#xFF0C;&#x540D;&#x79F0;&#x6211;&#x4EEC;&#x5C31;&#x547D;&#x4EE4;&#x4E3A;<code>book</code>&#xFF0C;&#x8FD9;&#x6837;&#x6211;&#x5C31;&#x5C31;&#x5F97;&#x5230;&#x4E86;&#x4E00;&#x4E2A;<code>book</code>&#x7684;&#x7A7A;&#x4ED3;&#x5E93;&#x3002;</li>
<li>&#x514B;&#x9686;&#x4ED3;&#x5E93;&#x5230;&#x672C;&#x5730;&#xFF1A;<code>git clone git@github.com:USER_NAME/book.git</code>&#x3002;</li>
<li>&#x521B;&#x5EFA;&#x4E00;&#x4E2A;&#x65B0;&#x5206;&#x652F;&#xFF1A;<code>git checkout -b gh-pages</code>&#xFF0C;&#x6CE8;&#x610F;&#xFF0C;&#x5206;&#x652F;&#x540D;&#x5FC5;&#x987B;&#x4E3A;<code>gh-pages</code>&#x3002;</li>
<li>&#x5C06;&#x5206;&#x652F;push&#x5230;&#x4ED3;&#x5E93;&#xFF1A;<code>git push -u origin gh-pages</code>&#x3002;</li>
<li>&#x5207;&#x6362;&#x5230;&#x4E3B;&#x5206;&#x652F;: <code>git checkout master</code>&#x3002;</li>
</ul>
<p>&#x7ECF;&#x8FC7;&#x8FD9;&#x4E00;&#x6B65;&#x5904;&#x7406;&#xFF0C;&#x6211;&#x4EEC;&#x5DF2;&#x7ECF;&#x521B;&#x5EFA;&#x597D;<code>gh-pages</code>&#x5206;&#x652F;&#x4E86;&#xFF0C;&#x6709;&#x4E86;&#x8FD9;&#x4E2A;&#x5206;&#x652F;&#xFF0C;Github&#x4F1A;&#x81EA;&#x52A8;&#x4E3A;&#x4F60;&#x5206;&#x914D;&#x4E00;&#x4E2A;&#x8BBF;&#x95EE;&#x7F51;&#x5740;&#xFF1A;</p>
<blockquote>
<p><a href="http://USERNAME.github.io/book" target="_blank">http://USERNAME.github.io/book</a></p>
</blockquote>
<p>&#x4F60;&#x53EF;&#x4EE5;&#x5728;&#x9879;&#x76EE;&#x9875;&#x9762;&#x53F3;&#x4E0B;<code>settings</code>&#x4E2D;&#x770B;&#x5230;&#xFF1A;</p>
<p><img src="../imgs/settings.png" alt=""></p>
<p>&#x5F53;&#x7136;&#xFF0C;&#x7531;&#x4E8E;&#x6211;&#x4EEC;&#x5185;&#x5BB9;&#x8FD8;&#x6CA1;&#x6709;&#x4E0A;&#x4F20;&#x6240;&#x4EE5;&#x4F60;&#x70B9;&#x5F00;&#x94FE;&#x63A5;&#xFF0C;&#x4E5F;&#x53EA;&#x662F;&#x4E00;&#x4E2A;404&#x9875;&#x9762;&#x3002;</p>
<h2 id="%E5%90%8C%E6%AD%A5%E9%9D%99%E6%80%81%E7%BD%91%E7%AB%99%E4%BB%A3%E7%A0%81%E5%88%B0%E5%88%86%E6%94%AF">&#x540C;&#x6B65;&#x9759;&#x6001;&#x7F51;&#x7AD9;&#x4EE3;&#x7801;&#x5230;&#x5206;&#x652F;</h2>
<p>&#x4E0B;&#x9762;&#x6211;&#x4EEC;&#x5C31;&#x53EF;&#x4EE5;&#x5C06;build&#x597D;&#x7684;&#x9759;&#x6001;&#x7F51;&#x7AD9;&#x4EE3;&#x7801;&#x540C;&#x6B65;&#x5230;<code>gh-pages</code>&#x5206;&#x652F;&#x4E2D;&#x53BB;&#x4E86;&#xFF1A;</p>
<ul>
<li>&#x5207;&#x6362;&#x51FA;master&#x5206;&#x652F;&#x76EE;&#x5F55;&#x3002;&#x6211;&#x4EEC;&#x9700;&#x8981;&#x5C06;<code>gh-pages</code>&#x5206;&#x652F;&#x5185;&#x5BB9;&#x5B58;&#x653E;&#x5230;&#x53E6;&#x4E00;&#x4E2A;&#x76EE;&#x5F55;&#x4E2D;&#x53BB;&#x3002;</li>
<li>&#x514B;&#x9686;<code>gh-pages</code>&#x5206;&#x652F;&#xFF1A;<code>git clone -b gh-pages git@github.com:USERNAME/book.git book-end</code>&#x3002;&#x8FD9;&#x6B65;&#x6211;&#x4EEC;&#x53EA;&#x514B;&#x9686;&#x4E86;<code>gh-pages</code>&#x5206;&#x652F;&#xFF0C;&#x5E76;&#x5B58;&#x653E;&#x5728;&#x4E00;&#x4E2A;&#x65B0;&#x7684;&#x76EE;&#x5F55;<code>book-end</code>&#x91CC;&#x9762;&#x3002;</li>
<li>Copy&#x9759;&#x6001;&#x591A;&#x7AD9;&#x4EE3;&#x7801;&#x5230;<code>book-end</code>&#x76EE;&#x5F55;&#x4E2D;&#x3002;</li>
<li>Push&#x5230;&#x4ED3;&#x5E93;&#x3002;</li>
</ul>
<p>&#x7136;&#x540E;&#xFF0C;&#x7B49;&#x5341;&#x6765;&#x5206;&#x949F;&#x7684;&#x6837;&#x5B50;&#xFF0C;&#x4F60;&#x5C31;&#x53EF;&#x4EE5;&#x8BBF;&#x95EE;&#x5230;&#x4F60;&#x7684;&#x5728;&#x7EBF;&#x56FE;&#x4E66;&#x4E86;&#x3002;&#x800C;&#x540E;&#xFF0C;&#x6BCF;&#x6B21;&#x4FEE;&#x6539;&#x4E4B;&#x540E;&#xFF0C;&#x90FD;&#x53EF;&#x4EE5;&#x5C06;&#x751F;&#x6210;&#x7684;&#x4EE3;&#x7801;Copy&#x5230;<code>book-end</code>&#x76EE;&#x5F55;&#xFF0C;&#x518D;Push&#x4E00;&#x4E0B;&#x5C31;OK&#x4E86;&#x3002;</p>
<p>&#x5F53;&#x7136;&#xFF0C;&#x5BF9;&#x4E8E;<code>gh-pages</code>&#x5B58;&#x653E;&#x95EE;&#x9898;&#xFF0C;&#x4F60;&#x4E5F;&#x53EF;&#x4EE5;&#x76F4;&#x63A5;&#x5728;master&#x5206;&#x652F;&#x76EE;&#x5F55;&#x4E2D;&#x76F4;&#x63A5;<code>git clone</code> gh-pages&#x5206;&#x652F;&#xFF0C;&#x5047;&#x5982;&#x540D;&#x79F0;&#x4E3A;<code>book-end</code>&#xFF0C;&#x7136;&#x540E;&#x4FEE;&#x6539;&#x4E00;&#x4E0B;<code>.gitignore</code>&#x6587;&#x4EF6;&#xFF0C;&#x5C06;<code>book-end/</code>&#x6DFB;&#x52A0;&#x8FDB;&#x53BB;&#xFF0C;&#x8FD9;&#x6837;&#x4E3B;&#x5206;&#x652F;&#x5C31;&#x4E0D;&#x4F1A;&#x7406;&#x4F1A;<code>book-end</code>&#x5185;&#x5BB9;&#x7684;&#x4FEE;&#x6539;&#x4E86;&#x3002;</p>
<p>&#x7B14;&#x8005;&#x66FE;&#x8BD5;&#x8FC7;&#x76F4;&#x63A5;&#x4F7F;&#x7528;<code>gitbook build --output=/PATH/book-end</code>&#x8FD9;&#x4E2A;&#x65B9;&#x5F0F;&#x8F93;&#x51FA;&#x5230;<code>gh-pages</code>&#x5206;&#x652F;&#x76EE;&#x5F55;&#x4E2D;&#xFF0C;&#x4F46;&#x53D1;&#x73B0;gitbook&#x5728;build&#x7684;&#x65F6;&#x5019;&#xFF0C;&#x76F8;&#x5F53;&#x4E8E;&#x5220;&#x9664;&#x5B58;&#x5728;&#x7684;&#x8FD9;&#x4E2A;&#x76EE;&#x5F55;&#xFF0C;&#x7136;&#x540E;&#x518D;&#x65B0;&#x5EFA;&#x76EE;&#x5F55;&#xFF0C;&#x518D;&#x5199;&#x5165;&#x5185;&#x5BB9;&#xFF0C;&#x539F;&#x6765;&#x7684;git&#x4FE1;&#x606F;&#x4F1A;&#x5B8C;&#x5168;&#x5220;&#x9664;&#x6389;&#xFF0C;&#x663E;&#x793A;&#x8FD9;&#x4E0D;&#x662F;&#x6211;&#x4EEC;&#x60F3;&#x8981;&#x770B;&#x5230;&#x7684;&#xFF0C;&#x6240;&#x4EE5;&#x53EA;&#x80FD;Copy&#x624D;&#x884C;&#x3002;</p>

                    
                    </section>
                
                
                </div>
            </div>
        </div>

        
        <a href="../publish/github.html" class="navigation navigation-prev " aria-label="Previous page: 发布到github仓库"><i class="fa fa-angle-left"></i></a>
        
        
        <a href="../end/index.html" class="navigation navigation-next " aria-label="Next page: 结束"><i class="fa fa-angle-right"></i></a>
        
    </div>
</div>

        
<script src="../gitbook/app.js"></script>

<script>
require(["gitbook"], function(gitbook) {
    var config = {"fontSettings":{"theme":null,"family":"sans","size":2}};
    gitbook.start(config);
});
</script>

        
    </body>
    
</html>
